package cn.ilikes.tools.nosql.jpa.metadatas.elements;

/**
 * 
 * @author fack
 * 
 */
public class JPAField {

	private JPAColumn column;

	private Relation relation;

	private boolean ableJPA;

	public JPAField(boolean ableJPA) {
		super();
		this.ableJPA = ableJPA;
	}

	public String getColumnName() {
		if (!relation.isAbleRelation())
			return column.getColumnName();
		else
			return relation.getColumnName();

	}

	public Relation getRelation() {

		return relation;
	}

	public boolean isRelation() {
		return relation.isAbleRelation();
	}

	public void setRelation(Relation relation) {
		this.relation = relation;
	}

	public JPAColumn getColumn() {
		return column;
	}

	public void setColumn(JPAColumn column) {
		this.column = column;
	}

	public boolean isAbleJPA() {
		return ableJPA;
	}

	public void setAbleJPA(boolean ableJPA) {
		this.ableJPA = ableJPA;
	}

}
